package ru.edu.vstu.atpp.acm.ui.services.authenticator;

import ru.edu.vstu.atpp.acm.ui.entities.Authors;
import ru.edu.vstu.atpp.acm.ui.security.AuthenticationException;

public interface Authenticator {

    /**
     * Gets the logged user
     *
     * @return User, the logged User
     */
    Authors getLoggedUser();

    /**
     * Checks if the current user is logged in
     *
     * @return true if the user is logged in
     */
    boolean isLoggedIn();

    /**
     * Logs the user.
     *
     * @param username
     * @param password
     * @throws AuthenticationException throw if an error occurs
     */
    void login(String username, String password) throws AuthenticationException;

    /**
     * Logs out the user
     */
    void logout();
}
